<?php
class Student {
	public $name='tom';
	protected $sex='男';
	private $age=22;

	public function show() {
		foreach($this as $k=>$v) {
			echo "{$k}-{$v}<br>";
		}
	}
}
//测试
$stu=new Student;
foreach($stu as $k=>$v) {
	echo "{$k}-{$v}<br>";
}
echo '<hr>';
$stu->show();

//遍历当前位置所能访问到的属性
?>